package com.example.fw;

public class ContactObject {
	public String firstName;
	public String lastName;
	public String address;
	public String home;
	public String mobile;
	public String work;
	public String email;
	public String email2;
	public String bday;
	public String bmonth;
	public String byear;
	public String selectgroup;
	public String address2;
	public String phone2;
	public String id;

	public ContactObject() {
	}

	public ContactObject(ContactObject oldContact) {
		this.id = oldContact.id;
		this.firstName = oldContact.firstName;
		this.lastName = oldContact.lastName;
		this.address = oldContact.address;
		this.home = oldContact.home;
		this.mobile = oldContact.work;
		this.work = oldContact.work;
		this.email = oldContact.email;
		this.email2 = oldContact.email2;
		this.bday = oldContact.bday;
		this.bmonth = oldContact.bmonth;
		this.byear = oldContact.byear;
		this.selectgroup = oldContact.selectgroup;
		this.address2 = oldContact.address2;
		this.phone2 = oldContact.phone2;
	}
	
	public String getFirstName() {
		return firstName;
	}

	public String getLastName() {
		return lastName;
	}

	public String getAddress() {
		return address;
	}

	public String getHome() {
		return home;
	}

	public String getMobile() {
		return mobile;
	}

	public String getWork() {
		return work;
	}

	public String getEmail() {
		return email;
	}

	public String getEmail2() {
		return email2;
	}

	public String getBday() {
		return bday;
	}

	public String getBmonth() {
		return bmonth;
	}

	public String getByear() {
		return byear;
	}

	public String getSelectgroup() {
		return selectgroup;
	}

	public String getAddress2() {
		return address2;
	}

	public String getPhone2() {
		return phone2;
	}

	public String getId() {
		return id;
	}

	public ContactObject setFirstName(String firstName) {
		this.firstName = firstName;
		return this;
	}

	public ContactObject setLastName(String lastName) {
		this.lastName = lastName;
		return this;
	}
	
	public ContactObject setAddress(String address) {
		this.address = address;
		return this;
	}
	
	public ContactObject setHome(String home) {
		this.home = home;
		return this;
	}
	
	public ContactObject setMobile(String mobile) {
		this.mobile = mobile;
		return this;
	}
	
	public ContactObject setWork(String work) {
		this.work = work;
		return this;
	}
	
	public ContactObject setEmail(String email) {
		this.email = email;
		return this;
	}
	
	public ContactObject setEmail2(String email2) {
		this.email2 = email2;
		return this;
	}
	
	public ContactObject setBday(String bday) {
		this.bday = bday;
		return this;
	}
	
	public ContactObject setBmonth(String bmonth) {
		this.bmonth = bmonth;
		return this;
	}
	
	public ContactObject setByear(String byear) {
		this.byear = byear;
		return this;
	}
	
	public ContactObject setSelectgroup(String selectgroup) {
		this.selectgroup = selectgroup;
		return this;
	}
	
	public ContactObject setAddress2(String address2) {
		this.address2 = address2;
		return this;
	}
	
	public ContactObject setPhone2(String phone2) {
		this.phone2 = phone2;
		return this;
	}
	
	public ContactObject setId(String id) {
		this.id = id;
		return this;
	}
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((firstName == null) ? 0 : firstName.hashCode());
		result = prime * result
				+ ((lastName == null) ? 0 : lastName.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ContactObject other = (ContactObject) obj;
		if (firstName == null) {
			if (other.firstName != null)
				return false;
		} else if (!firstName.equals(other.firstName))
			return false;
		if (lastName == null) {
			if (other.lastName != null)
				return false;
		} else if (!lastName.equals(other.lastName))
			return false;
		if (id != null && other.id != null) {
			return id.equals(other.id);
		}

		return true;
	}

	@Override
	public String toString() {
		return "Contact [" + id + ": " + firstName
				+ " " + lastName + "]";
	}

}